import java.awt.HeadlessException;
import java.io.IOException;

import javax.swing.JFileChooser;
import javax.swing.JOptionPane;

public class TestJC {
	public static void main(String[] args)throws HeadlessException,IOException{
		JFileChooser fChooser = new JFileChooser();
		int r = fChooser.showOpenDialog(null);
		if(r== fChooser.APPROVE_OPTION){
			JOptionPane.showMessageDialog(null,fChooser.getSelectedFile().getCanonicalPath());
		}
}
}
